package com.ruoyi.system.service.req;

import com.ruoyi.common.core.domain.entity.RestaurantGoodsDetail;
import lombok.Builder;
import lombok.Data;

/**
 * @author：liyouxin
 * @date：2023/8/15 21:56
 */
@Data
@Builder
public class CreateGoodsDetailDTO {
	private Long resourceId;
	private Integer amount;
	private String unit;

	public static RestaurantGoodsDetail convertToDO(Long goodsId, CreateGoodsDetailDTO detailDTO) {
		return RestaurantGoodsDetail.builder()
						.goodsId(goodsId)
						.resourceId(detailDTO.getResourceId())
						.unit(detailDTO.getUnit())
						.amount(detailDTO.getAmount())
						.build();
	}
}
